package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.PromptDao;
import com.mentaleye.dal.model.Prompt;
import com.mentaleye.dal.service.PromptMapper;

@Repository
public class PromptDaoImpl implements PromptDao {
	@Autowired
	private PromptMapper promptMapper;

	@Override
	public boolean insertPrompt(Prompt prompt) {
		int result = promptMapper.insert(prompt);
		return result > 0;
	}

	@Override
	public List<Map<String, Object>> selectPromptByTypeAndPerson(Map<String, Object> map) {
		List<Map<String, Object>> list = promptMapper.selectByMap(map);
		return list;
	}

	@Override
	public List<Map<String, Object>> selectCountWithNoRead(Map<String, Object> map) {
		List<Map<String, Object>> list = promptMapper.selectCountByMap(map);
		return list;
	}

}
